package com.zw.gulimall.order.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.zw.common.entity.order.PaymentInfoEntity;
import com.zw.common.utils.PageUtils;
import com.zw.common.entity.order.OrderEntity;
import com.zw.common.vo.order.OrderConfirmVO;
import com.zw.common.vo.order.OrderSubmitVO;
import com.zw.common.vo.order.PayVO;
import com.zw.common.vo.order.SubmitOrderResponseVO;

import java.util.Map;

/**
 * 订单
 *
 * @author zw
 * @email Alisinngai@gmail.com
 * @date 2023-06-12 01:04:48
 */
public interface OrderService extends IService<OrderEntity> {

    PageUtils queryPage(Map<String, Object> params);

    OrderConfirmVO OrderConfirmVO() throws Exception;

    /**
     * 创建订单
     */
    SubmitOrderResponseVO submitOrder(OrderSubmitVO vo) throws Exception;

    /**
     * 获取订单详情
     */
    OrderEntity getOrderByOrderSn(String orderSn);

    void closeOrder(OrderEntity order);

    /**
     * 获取订单支付的详细信息
     *
     * @param orderSn 订单号
     */
    public PayVO getOrderPay(String orderSn);

    void handlePayResult(Integer orderStatus, Integer payCode, PaymentInfoEntity paymentInfo);

    /**
     * 分页查询订单列表、订单详情
     *
     * @param params
     * @return
     */
    PageUtils queryPageWithItem(Map<String, Object> params);
}

